<template>
	<router-view ref="HBBigData" v-if="subRouterAlive" @changeMainIndex="handleChangeMainIndex" @updateBadge="updateBadge"></router-view>
</template>

<script>
	export default {
		provide() {
			return {
				subRouterreload: this.subRouterreload
			}
		},
	    data() {
	        return {
				subRouterAlive: true,
	        }
	    },
	    computed: {
			
	    },
		created() {
			this.toIndex();
		},
	    methods:{
			// 根据路径绑定到对应的一级菜单，防止页面刷新重新跳回第一个
			toIndex() {
				//alert(this.$route.path.split('/')[1]);
				if (this.$route.path.split('/')[1] == "")
				{
					this.$router.push('/HBBigData');
				}
				else
				{
					return this.$route.path.split('/')[1];
				}
			    
			},
			subRouterreload () {
				this.subRouterAlive = false;
				this.$nextTick(function(){
					this.subRouterAlive = true;
				})
			},
	        // 切换菜单栏
	        handleChangeMainIndex(index) {
	            this.$router.push('/main/' + index);
	        },
			// 回写主页面预警数量
			updateBadge(validCount) {
				this.$emit('updateBadge',validCount);
			},
	    }
	}
</script>

<style>
	.el-table {
		background-color: #090f1a;
		opacity: 0.8;
	}
	.el-table th {
	    overflow: hidden;
	    -webkit-user-select: none;
	    -moz-user-select: none;
	    -ms-user-select: none;
	    user-select: none;
	    background-color: #062756;
	}
	.el-table th.is-leaf, .el-table td {
	    border-bottom: 1px solid #1E7EF4;
	}
	
	.el-table tbody tr>td {
		background-color: #090f1a !important;
	}
	.el-table tbody tr:hover>td {
		background-color: #365795 !important;
		color: #00ffff;
	} 
	.el-table__body-wrapper::-webkit-scrollbar{
		/*width: 0;宽度为0隐藏*/
		width: 3px;
	}
	.el-table__body-wrapper::-webkit-scrollbar-thumb{
	    border-radius: 2px;
	    height: 50px;
	    background-color: #55aaff;
	}
	.el-table__body-wrapper::-webkit-scrollbar-track{
	    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
	    border-radius: 0px;
	    background-color: rgba(9, 15, 26, 0.8);
	}
</style>
